package com.ecoolex.hotel.saas.ws;

import java.util.List;

import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import com.ecoolex.framework.common.exception.BizException;
import com.ecoolex.framework.common.pojo.Page;
import com.ecoolex.framework.common.pojo.Pagination;
import com.ecoolex.hotel.saas.core.manager.PresaleCouponOrderAfterSalesManager;
import com.ecoolex.hotel.saas.core.manager.PresaleCouponOrderAfterSalesRecordManager;
import com.ecoolex.hotel.saas.core.manager.PresaleCouponOrderDetailManager;
import com.ecoolex.hotel.saas.core.manager.PresaleCouponOrderManager;
import com.ecoolex.hotel.saas.core.manager.PresaleCouponOrderOperateRecordManager;
import com.ecoolex.hotel.saas.entity.PresaleCouponOrder;
import com.ecoolex.hotel.saas.entity.PresaleCouponOrderAfterSales;
import com.ecoolex.hotel.saas.entity.PresaleCouponOrderAfterSalesRecord;
import com.ecoolex.hotel.saas.entity.PresaleCouponOrderDetail;
import com.ecoolex.hotel.saas.entity.PresaleCouponOrderOperateRecord;
import com.ecoolex.hotel.saas.pojo.QueryPresaleCouponOrderAfterSalesDTO;
import com.ecoolex.hotel.saas.pojo.QueryPresaleCouponOrderDTO;
import com.ecoolex.hotel.saas.pojo.SubmitPresaleCouponOrderDTO;

@Service
public class PresaleCouponOrderServiceImpl implements PresaleCouponOrderService{
	
	@Autowired
	private PresaleCouponOrderManager presaleCouponOrderManager;

	@Override
	public PresaleCouponOrder getForUser(Integer orderId, Integer userId) {
		return presaleCouponOrderManager.getForUser(orderId, userId);
	}

	@Override
	public Pagination<PresaleCouponOrder> queryForUser(Integer storeId, Integer status, Integer userId, Page page) {
		return presaleCouponOrderManager.queryForUser(storeId, status, userId, page);
	}

	@Override
	public PresaleCouponOrder submit(SubmitPresaleCouponOrderDTO submit, String createUser) throws BizException {
		return presaleCouponOrderManager.submit(submit, createUser);
	}

	@Override
	public PresaleCouponOrder applyOfflinePay(PresaleCouponOrder order, String updateUser) throws BizException {
		return presaleCouponOrderManager.applyOfflinePay(order,updateUser);
	}

	@Override
	public PresaleCouponOrder cancel(PresaleCouponOrder order, String updateUser) throws BizException {
		return presaleCouponOrderManager.cancel(order, updateUser);
	}

	@Override
	public PresaleCouponOrder delete(PresaleCouponOrder order, String updateUser) throws BizException {
		return presaleCouponOrderManager.delete(order, updateUser);
	}

	@Override
	public PresaleCouponOrder get(Integer orderId) {
		return presaleCouponOrderManager.get(orderId);
	}

	@Override
	public Pagination<PresaleCouponOrder> query(QueryPresaleCouponOrderDTO query, Page page) {
		return presaleCouponOrderManager.query(query, page);
	}
	
	@Override
	public Boolean couponCodeVerify(Integer storeId, String couponCode, String updateUser) throws BizException {
		return presaleCouponOrderManager.couponCodeVerify(storeId, couponCode, updateUser);
	}
	
	@Override
	public Boolean cancelVerify(PresaleCouponOrder order, String remark, String updateUser) throws BizException {
		return presaleCouponOrderManager.cancelVerify(order, remark, updateUser);
	}

	@Override
	public PresaleCouponOrder confirmOfflinePay(PresaleCouponOrder order, String updateUser) throws BizException {
		return presaleCouponOrderManager.confirmOfflinePay(order,updateUser);
	}

	@Override
	public PresaleCouponOrder refund(PresaleCouponOrder order, String updateUser) throws BizException {
		return presaleCouponOrderManager.refund(order, updateUser);
	}

	@Override
	public PresaleCouponOrder applyRefund(PresaleCouponOrder order, String remark, String evidenceImage, String updateUser) throws BizException {
		return presaleCouponOrderManager.applyRefund(order, remark, evidenceImage, updateUser);
	}

	@Override
	public Boolean presaleCouponCanRefund(Integer orderId) {
		return presaleCouponOrderManager.presaleCouponCanRefund(orderId);
	}
	
	@Autowired
	private PresaleCouponOrderDetailManager detailManager;
	
	@Override
	public List<PresaleCouponOrderDetail> queryOrderDetail(Integer orderId) {
		return detailManager.queryByOrderId(orderId);
	}
	
	@Autowired
	private PresaleCouponOrderAfterSalesManager afterSalesManager;

	@Override
	public PresaleCouponOrderAfterSales getAfterSales(Integer afterSalesId) {
		return afterSalesManager.getAfterSales(afterSalesId);
	}

	@Override
	public Pagination<PresaleCouponOrderAfterSales> queryAfterSales(QueryPresaleCouponOrderAfterSalesDTO query, Page page) {
		return afterSalesManager.queryAfterSales(query, page);
	}

	@Override
	public PresaleCouponOrderAfterSales agreeRefund(PresaleCouponOrderAfterSales afterSales, String updateUser) throws BizException {
		return afterSalesManager.agreeRefund(afterSales, updateUser);
	}

	@Override
	public PresaleCouponOrderAfterSales refuseRefund(PresaleCouponOrderAfterSales afterSales, String updateUser) throws BizException {
		return afterSalesManager.refuseRefund(afterSales, updateUser);
	}

	@Override
	public Pagination<PresaleCouponOrderAfterSales> queryAfterSalesForUser(Integer storeId, Integer userId, Page page) {
		return afterSalesManager.queryAfterSalesForUser(storeId, userId, page);
	}

	@Override
	public PresaleCouponOrderAfterSales cancelApply(PresaleCouponOrderAfterSales afterSales, String updateUser) throws BizException {
		return afterSalesManager.cancelApply(afterSales, updateUser);
	}

	@Override
	public PresaleCouponOrderAfterSales delete(PresaleCouponOrderAfterSales afterSales, String updateUser) throws BizException {
		return afterSalesManager.delete(afterSales, updateUser);
	}
	
	@Override
	public PresaleCouponOrderAfterSales getLastestByOrderId(Integer orderId) {
		return afterSalesManager.getLastestByOrderId(orderId);
	}
	
	@Autowired
	private PresaleCouponOrderAfterSalesRecordManager recordManager;

	@Override
	public List<PresaleCouponOrderAfterSalesRecord> afterSalesRecord(Integer afterSalesId) {
		return recordManager.afterSalesRecord(afterSalesId);
	}
	
	@Autowired
	private PresaleCouponOrderOperateRecordManager operateRecordManager;

	@Override
	public List<PresaleCouponOrderOperateRecord> operateRecordList(Integer orderId) {
		return operateRecordManager.operateRecordList(orderId);
	}

}
